<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML" 4.01"//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- Created: September 6, 2001-->
<!--
$Id: TubeDel.php,v 1.3 2001/11/02 19:12:27 eugenem Exp $
$Header: /export/home/eugenem/public_html/ComplianceReports/RCS/TubeDel.php,v 1.3 2001/11/02 19:12:27 eugenem Exp $
$Log: TubeDel.php,v $
Revision 1.3  2001/11/02 19:12:27  eugenem
Moved HTTP_*_VARS processing to dbc.inc

Revision 1.2  2001/11/02 15:01:14  eugenem
Moved database connect statements to a separate file.

Revision 1.1  2001/09/06 16:38:41  eugenem
Initial revision

-->

<html>
<head>
<title>Radiological Equipment Database</title>
<meta name="author" content="Eugene Mah">
<link rev="made" href="mailto:eugenem@ix.netcom.com">
<link rev="home" href="http://home.netcom.com/~eugenem/">
<meta name="description" content="">
<meta name="Keywords" content="">
<meta name="Reply-to" content="eugenem@ix.netcom.com">
<META http-equiv="PICS-Label" content='(PICS-1.1 "http://www.classify.org/safesurf/" l r (SS~~0001))'>
<?PHP
require('functions.inc');
require('dbc.inc');

?>
</head>

<body>
<h1>Radiological Equipment Database</h1>
<h2>Delete a tube</h2>
<?PHP
if (isset($TubeID)) {
  if (!isset($RemoveDate) || $RemoveDate=="" || empty($RemoveDate)) $RemoveDate = date("Y-m-d");
  $query = "UPDATE Tubes SET Status=\"$Status\",RemoveDate=$RemoveDate WHERE TubeID=$TubeID";
  $result = mysql_query($query)
    or die ("<p>Unable to update status: $query</p>\n");
  if ($result) echo "<p>Status of Tube $TubeID updated</p>\n";
}
?>
<form action="TubeDel.php" method="POST">
<p>Select a tube to deactivate:
<?PHP
$tubes = mysql_query("select TubeID,concat_ws('-',Description,InsertSN) from Tubes,Machines where Machines.MachineID=Tubes.MachineID and Tubes.Status=\"Active\" and Machines.Status=\"Active\" order by Description");
echo listbox_field($tubes,"TubeID","");
?>
</p>
<p>Set tube status</p>
<p>
  <input type="radio" name="Status" value="Active">Active</input>
  <input type="radio" name="Status" value="Inactive">Inactive</input>
  <input type="radio" name="status" value="Removed" selected="selected">Removed</input>
</p>
<p>Date Removed (YYYY-MM-DD): <input type="TEXT" name="RemoveDate" size="10"></p>
<p><input type="SUBMIT" value="Deactivate"> / <input type="RESET" value="Reset"> / <a href="index.html" target="_top">Main</a></p>
</form>
<?PHP mysql_close() ?>
</body>
</html>
